<script setup>
import { toRefs } from 'vue'

const props = defineProps(['list'])
const { list } = toRefs(props)
console.log(list.value)
</script>
<template>
  <div class="list-item">
    <div class="list-item-img">
      <img :src="`http://www.dell-lee.com/imgs/vue3/${list.imgName}.png`" alt="" />
    </div>
    <div class="list-item-content">
      <div class="left">
        <div class="top">{{ list.title }}</div>
        <div class="bottom">￥{{ list.price }}x{{ list.number }}</div>
      </div>
      <div class="right">￥{{ (list.price * list.number).toFixed(2) }}</div>
    </div>
  </div>
</template>
<style scoped lang='scss'>
.list-item {
  display: flex;
  height: 60px;
  width: 95%;
  margin: 0 auto;
  align-items: center;
  padding: 5px;
  margin-top: 10px;

  &-img {
    width: 30%;
    & img {
      width: 60%;
      height: 60%;
    }
  }
  &-content {
    width: 80%;
    height: 100%;
    margin-left: -20px;
    display: flex;
    justify-content: space-between;
    flex-direction: column-reverse;
    flex-wrap: wrap;
    & .left {
      width: 60%;
      height: 100%;
      & .top {
        font-size: 16px;
        font-weight: 800;
      }
      & .bottom {
        margin-top: 5px;
        color: red;
        font-size: 16px;
      }
    }
    & .right {
      width: 25%;
      font-weight: 600;
      font-size: 15px;
      margin-bottom: 15px;
    }
  }
}
</style>